# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=speex

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.2rc1
pkgrel=2
pkgdesc="A free codec for free speech (mingw-w64)"
arch=('any')
license=('BSD')
url="http://www.speex.org/"
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-libogg")
options=('strip' '!libtool' 'staticlibs')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"  "${MINGW_PACKAGE_PREFIX}-pkg-config")
source=(http://downloads.us.xiph.org/releases/${_realname}/${_realname}-$pkgver.tar.gz)
md5sums=('c4438b22c08e5811ff10e2b06ee9b9ae')

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}
}

build() {
  export lt_cv_deplibs_check_method='pass_all'
  mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}
  ${srcdir}/${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --disable-static

  make
}

package() {
  cd ${srcdir}/build-${MINGW_CHOST}
  make DESTDIR="${pkgdir}" install
  install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/$pkgname/LICENSE"
}
